﻿@model Lottery.Models.Home.OrderModel
@{
    ViewBag.Title = "会员系统 - 下单";
    Model.Caption = "下单";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#btnConfirm").click(function () {
                $('form').submit();
            }
        );

        $("#date").ligerDateEditor({ showTime: false, label: '日期', initValue: '@Model.OrderDay.ToString("yyyy-MM-dd")', format: "yyyy-MM-dd" });

        $(".s1d").attr("disabled", $(".s1").attr("checked") != "checked");
        $(".s2d").attr("disabled", $(".s2").attr("checked") != "checked");
        $(".s3d").attr("disabled", $(".s3").attr("checked") != "checked");
        $(".s4d").attr("disabled", $(".s4").attr("checked") != "checked");
    });

    function state1() {
        $(".s1d").attr("disabled", $(".s1").attr("checked") == "undifined");
        $(".s2d").attr("disabled", $(".s1").attr("checked") == "checked");
        $(".s3d").attr("disabled", $(".s1").attr("checked") == "checked");
        $(".s4d").attr("disabled", $(".s1").attr("checked") == "checked");
    }
    function state2() {
        $(".s1d").attr("disabled", $(".s2").attr("checked") == "checked");
        $(".s2d").attr("disabled", $(".s2").attr("checked") == "undifined");
        $(".s3d").attr("disabled", $(".s2").attr("checked") == "checked");
        $(".s4d").attr("disabled", $(".s2").attr("checked") == "checked");
    }
    function state3() {
        $(".s1d").attr("disabled", $(".s3").attr("checked") == "checked");
        $(".s2d").attr("disabled", $(".s3").attr("checked") == "checked");
        $(".s3d").attr("disabled", $(".s3").attr("checked") == "undifined");
        $(".s4d").attr("disabled", $(".s3").attr("checked") == "checked");
    }
    function state4() {
        $(".s1d").attr("disabled", $(".s4").attr("checked") == "checked");
        $(".s2d").attr("disabled", $(".s4").attr("checked") == "checked");
        $(".s3d").attr("disabled", $(".s4").attr("checked") == "checked");
        $(".s4d").attr("disabled", $(".s4").attr("checked") == "undifined");
    }
</script>
@using (Html.BeginForm())
{ 
    <div class="system_input_contain">
        <div class="input-text">
            @Html.TextBox("OrderDay", Model.OrderDay, new { @id = "date" })
            @Html.ValidationMessageFor(m => m.OrderDay, new { style = "color:Red" })
        </div>
        <div class="input-text">
            @Html.RadioButtonFor(m => m.ProductType, "1", new { onclick = "state1()", @class = "s1" })
            @Html.LabelFor(m => m.Number)
            @Html.TextBoxFor(m => m.Number, new { @class = "s1d" })
            @Html.ValidationMessageFor(m => m.Number, new { style = "color:Red" })
        </div>
        <div class="input-text">
            @Html.RadioButtonFor(m => m.ProductType, "2", new { onclick = "state2()", @class = "s2" })
            @Html.LabelFor(m => m.单双)
            @Html.DropDownListFor(m => m.单双, new SelectList(Model.单双List), new { @class = "s2d" })
            @Html.ValidationMessageFor(m => m.单双, new { style = "color:Red" })
        </div>
        <div class="input-text">
            @Html.RadioButtonFor(m => m.ProductType, "3", new { onclick = "state3()", @class = "s3" })
            @Html.LabelFor(m => m.生肖)
            @Html.DropDownListFor(m => m.生肖, new SelectList(Model.生肖List), new { @class = "s3d" })
            @Html.ValidationMessageFor(m => m.生肖, new { style = "color:Red" })
        </div>
        <div class="input-text">
            @Html.RadioButtonFor(m => m.ProductType, "4", new { onclick = "state4()", @class = "s4" })
            @Html.LabelFor(m => m.Color)
            @Html.DropDownListFor(m => m.Color, new SelectList(Model.ColorList), new { @class = "s4d" })
            @Html.ValidationMessageFor(m => m.Color, new { style = "color:Red" })
        </div>
        <div class="input-text">
            @Html.LabelFor(m => m.Money)
            @Html.TextBoxFor(m => m.Money)
            @Html.ValidationMessageFor(m => m.Money, new { style = "color:Red" })
        </div>
        <div class="input-text">
            <input type="button" id="btnConfirm" value="提交" />
        </div>
        
    </div>
}
